﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
using fsw.Common;

namespace fsw.Web.Mould
{
    public partial class Add : Web.UI.ManagePage
    {
        protected Model.Admin model_admin;
        protected void Page_Load(object sender, EventArgs e)
        {
            model_admin = GetAdminInfo();
            if (model_admin.TypeId > 1) Response.End();
            if (DTRequest.IsPost())
            {
                Response.Write(DoAdd());
                Response.End();
            }
        }
        protected string DoAdd()
        {
            string MouldName = DTRequest.GetFormString("MouldName");//项目名称
            int OrderNo = DTRequest.GetFormInt("OrderNo");//排序  
            Model.Mould model = new Model.Mould();
            model.MouldName = MouldName;
            model.OrderNo = OrderNo;
            model.CreatorId = model_admin.Id;
            model.CreateDate = Utils.ConvertDateTimeInt(DateTime.Now);
            BLL.Mould bll = new BLL.Mould();
            if (bll.Add(model) > 0)
            {
                AdminAddLog(model_admin.UserName, "添加" + MouldName + "模块成功!");
                return JsonErr("success", "添加模块成功!");
            }
            return JsonErr("error", "参数错误 ");
        }
    }
}